home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / AIAT 1.0.1 / Headers / Index / FreqPosting.h next >
Encoding:
Text File  |  1997-09-11  |  883 b   |  41 lines  |  [TEXT/CWIE]

  1. // FreqPosting.h
  2. //    Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  3.  
  4. // Struct used by TermIndex and its subclasses.
  5.  
  6. #pragma once
  7. #ifndef FreqPosting_h
  8. #define FreqPosting_h
  9.  
  10. #pragma import on
  11.  
  12. #include "TermIndex.h"
  13.  
  14. #pragma IA_BEGIN_EXPORTS
  15.  
  16. // FreqPosting: represents an occurence of a term.
  17. struct FreqPosting {
  18.     friend class InvertedIndex;
  19. public:
  20.         FreqPosting() {}
  21.         FreqPosting(DocID i, DocLength f) : docID(i), freq(f) {}
  22.         
  23.         void SetDocID (DocID docid) {docID = docid;}
  24.         DocID GetDocID () {return docID;}
  25.         
  26.         void SetFreq (DocLength    frequency) {freq = frequency;}
  27.         DocLength GetFreq() {return freq;}
  28.         
  29. private:    
  30.     void*            operator new(size_t size);        // stack or array allocate only
  31.     DocID             docID;                // document the term occurred in
  32.     DocLength        freq;                // number of times it occurred
  33.  
  34. };
  35.  
  36. #pragma IA_END_EXPORTS
  37.  
  38. #pragma import reset
  39.  
  40. #endif
  41.